Declare Sub Initadc()
Sub Initadc()
   Dim wInputADC As Word
   'configure single mode and auto prescaler setting
   'The single mode must be used with the GETADC() function
   'The prescaler divides the internal clock by 2,4,8,16,32,64 or 128
   'Because the ADC needs a clock from 50-200 KHz
   'The AUTO feature, will select the highest clockrate possible
   Config Adc = Single , Prescaler = Auto
   'Now give power to the chip
   Start Adc                                                ' NOT required since it will start automatic
   Winputadc = Getadc(0)
End SUB
